package com.li.utilstest.dialog

import android.content.Context
import androidx.core.content.ContextCompat
import com.li.utilstest.R
import com.lxj.xpopup.XPopup

/**
 *@PackageName: net.airice.iot.console.dialog
 *@Class: DialogUtil
 *@Author: lyg
 *@Date: 2021/6/23-15:14
 *@Description: 弹框工具类
 */
object DialogUtil {
    fun showDialog(context: Context,title:String?,content:String):CenterDialog{
        val dialog= CenterDialog(context,content)
        XPopup.Builder(context)
            .dismissOnTouchOutside(false)
            .hasStatusBarShadow(false)
            .hasNavigationBar(false)
            .asCustom(dialog)
            .show()
        return dialog
    }

    fun showDeleteDialog(context: Context):DeleteBottomDialog{
        val dialog= DeleteBottomDialog(context)
        XPopup.Builder(context)
            .dismissOnTouchOutside(false)
            .hasStatusBarShadow(false)
            .hasNavigationBar(false)
            .shadowBgColor(ContextCompat.getColor(context, R.color.delete_bg))
            .asCustom(dialog)
            .show()
        return dialog
    }
}